#include <iostream>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;

vector<int> A;
int backadd[50];
int st[50];
int ans = 0x3f3f3f3f;

void dfs(int cnt, int n, int sum, double m)
{
    if (cnt == n || m <= 0 || sum >= ans || m > backadd[cnt])
    {
        if (m == 0)
        {
            ans = min(ans, sum);
        }
        return;
    }

    dfs(cnt + 1, n, sum, m - A[cnt]);
    dfs(cnt + 1, n, sum + 1, m - A[cnt] * 1.0 / 2);
    dfs(cnt + 1, n, sum, m);
}

bool cmp(int a, int b)
{
    return a > b;
}
int main()
{
    int n, m;
    memset(backadd, 0, sizeof(backadd));
    scanf("%d%d", &n, &m);
    for (int i = 0; i < n; i++)
    {
        int a;
        scanf("%d", &a);
        A.push_back(a);
    }
    sort(A.begin(), A.end(), cmp);
    for (int i = n-1; i >= 0; i--)
    {
        backadd[i] = backadd[i+1] + A[i];
    }
    dfs(0, n, 0, m);
    if (ans == 0x3f3f3f3f)
        printf("-1\n");
    else
        printf("%d\n", ans);

    return 0;
}